import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import AutoImport from 'unplugin-auto-import/vite'

import mdx from '@mdx-js/rollup'
import { babel } from '@rollup/plugin-babel'
import remarkGfm from 'remark-gfm'


// https://vitejs.dev/config/
export default defineConfig({

  plugins: [
    vue(),
    vueJsx({}),
    AutoImport({
      imports: ['vue']
    }),
    mdx({
      jsx:true,
      remarkPlugins:[
        remarkGfm,
      ]
    }),
    babel({
      // Also run on what used to be `.mdx` (but is now JS):
      extensions: ['.js', '.jsx', '.cjs', '.mjs', '.md', '.mdx'],
      "plugins": ["@vue/babel-plugin-jsx"]
    })
  ],


  resolve:{
    alias:{
      '@' : '/src'
    },
    extensions: ['.js', '.ts', '.vue', '.tsx'] //省略后缀
  },

  server:{
    open: true
  }

})
